const Router = require('koa-router')
//

const { create, update, get, list, del } = require('../controller/sys')

const {
  getValidator,
  createValidator,
  updateValidator,
  delValidator,
  listValidator,
} = require('../middleware/validator/sys')

const PREFIX = '/v1/sys'

const router = new Router({ prefix: PREFIX })

router.get('/get', getValidator, get)

router.post('/create', createValidator, create)

router.put('/update', updateValidator, update)

router.del('/del', delValidator, del)

router.get('/list', listValidator, list)

module.exports = router
